const http = 'http://www.shunzi.icu'
 const post=(url = '', data = {}) => {
  return new Promise((resolve,reject)=>{
    wx.request({
      url: url,
      data,
      method: 'POST',
      header: {
        'content-type': 'application/json'
      },
      success:(res)=>{
        resolve(res)
      },
      fail:(err)=>{
        reject(err)
      },
    })
  })
}
 const get=(url = '', data = {}) => {
    return new Promise((resolve,reject)=>{
      wx.request({
        url: url,
        data,
        method: 'GET',
        header: {
          'content-type': 'application/json'
        },
        success:(res)=>{
          resolve(res)
        },
        fail:(err)=>{
          reject(err)
        },
      })
    })
  }


export default {
  post,
  get,
  http
};